package com.fcl.blog.web.user;

import com.fcl.blog.comment.Result;
import com.fcl.blog.po.Type;
import com.fcl.blog.po.TypeTop;
import com.fcl.blog.service.BlogService;
import com.fcl.blog.service.TypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.swing.*;
import java.util.List;

/**
 * @Author 付
 * @Date 2023/11/2 13:22
 * @Version 1.0
 * @description
 * @since 1.0
 */

@RestController
@RequestMapping("/user")
@Slf4j
public class UserTypeController {

    @Autowired
    private TypeService typeService;
    @Autowired
    private BlogService blogService;

    @GetMapping("/view/type")
    public Result userListType(){

        Long total = typeService.total();
        List<TypeTop> types = typeService.typeTopAll();
        return Result.success(types);
    }

}
